package com.sam.demo.spring.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

@Service
public class UserService {
	
	private Logger logger = LoggerFactory.getLogger("UserServiceLog");
	
	public String getUserName() {
		try {
			logger.info("输出日志");
			if(1==1) {
				throw new RuntimeException("异常消息");
			}
			return "hello";
		} catch (Exception e) {
			logger.error("测试异常, {}", e.getMessage(), e);
		}
		return null;
	}
}
